<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">

		<style>
			html,
			body {
				height: 100%;
				overflow: hidden;
				margin: 0;
				padding: 0;
				box-sizing: border-box;
				background-color: rgba(0, 0, 0, 0.3);
				color: white;
				font-size: 0.625rem;
			}

			iframe {
				width: 100%;
				height: 100%;
				border: none;
			}
		</style>

	</head>
	<body>

	</body>
	<script type="text/javascript">
		window.onload = function() {
			var iframe = document.createElement('iframe');
			iframe.style.width = '100%';
			iframe.style.height = '100%';
			iframe.style.border = 'none';

			// 根据条件判断加载不同的页面
			let netVersion = "1.0";
			var localVersion = "1.0";

			try {
				AndroidInterface.disableCancel(false);
			} catch (e) {
				//TODO handle the exception
			}

			try {
				localVersion = AndroidInterface.getAppVersionName();
			} catch (e) {
				//TODO handle the exception
			}

			var net = Number(netVersion);
			var local = Number(localVersion);

			if (net > local) {

				iframe.src = 'update.html';

				try {
					AndroidInterface.toast("请更新版本!");
				} catch (e) {
					//TODO handle the exception
				}

			} else {

				iframe.src = 'ad.html';

			}

			document.body.appendChild(iframe);
		};
	</script>
</html>